<?php
/**
 * Created by PhpStorm.
 * User: xuezhileikaku
 * Email:chengyingbo88@163.com
 * Date: 2024/8/23
 * Time: 下午6:26
 */

namespace App\Logger;

use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Psr\Log\LoggerInterface;

class LoggerFactory
{
    public static function createLogger(): LoggerInterface
    {
        $logger = new Logger('microservice_logger');
        $logger->pushHandler(new StreamHandler(__DIR__ . '/../../logs/app.log', Logger::DEBUG));

        return $logger;
    }
}
